Skip to content

Lock workflow dependencies with an Actions lockfile - #53

Merged
agorischek merged 6 commits into
mainfrom
actions-lockfile
Nov 19, 2026
Merged

agorischek merged 6 commits into
mainfrom
actions-lockfile

Conversation

@agorischek

Copy link
Copy Markdown
Collaborator

What changed

Adopts the GitHub Actions workflow lockfile (GA 2026-10-28) for every workflow, as an early example for the githubnext org's pinning push.

  • .github/workflows/actions.lock (generated by gh actions-lock) onboards all 10 workflows and locks every action, including transitive ones reached through our composite actions, to its commit and source repository ID. The runner refuses an action a workflow's lockfile doesn't lock.
  • SHA → exact release tags, same commits. The docs say SHA pinning is unnecessary for onboarded workflows, the lockfile being "the better option", and the tool warns sha-as-ref ("pin to a tag instead") and rewrites SHAs to tags in fix mode. Every SHA was mapped to the exact full semver tag at the same commit (e.g. actions/checkout@d23441a… → @v6.1.0), so no action code changes. Exact tags (not v6) must still point at the locked commit or the lockfile check fails.
  • Composite actions are called as $/.github/actions/<name> (--migrate-local-actions), so the lockfile can follow them and lock their actions.
  • The published action.yml keeps its full SHAs. The repositories that use githubnext/projections@v0 don't have our lockfile. gh-actions-lock 0.4.1 rewrites them anyway; that's fixed on its main (github/gh-actions-lock#298, plus #300 for exact SHA lock keys) but not released yet. The lockfile was generated with a build of its main (81b70d1). 0.4.1's --verify accepts it.
  • action-e2e keeps uses: ./ for the root action: build-from-source builds from GITHUB_ACTION_PATH, and with $/ that would be a fresh copy without the job's target/ or node_modules. Following the docs' "keeping a local path action" pattern, a never-run step (if: false) uses .github/actions/action-dependencies, which lists the root action's actions at the same SHAs so ci.yml locks them. A test keeps the two in step.
  • dist: release.yml stays exactly what dist generate writes. dist formats [dist.github-action-commits] values as name@value without validating them (its own defaults are tags), so those values and .github/release-build-setup.yml now hold the same exact tags. dist generate output is byte-identical to what gh-actions-lock wrote. release.test.mjs now requires each release action at an exact tag that the lockfile locks for that workflow, not a SHA.
  • CI: a new actions-lock job runs gh actions-lock --verify --ignore-local-actions with the extension pinned to v0.4.1, on PRs, main and the weekly schedule (so a moved upstream tag is caught).
  • actionlint 1.7.12 doesn't know $/ steps yet: .github/actionlint.yaml ignores only that message for ci.yml/engine-quality.yml, plus the if: false constant for ci.yml.
  • CONTRIBUTING.md has a new Workflow dependency lockfile section; docs/runner/building.md mentions the new actionlint ignores.

Not covered: the build-local-artifacts container image in release.yml is a dist-generated ${{ matrix.container… }} expression, which the lockfile can't check (a warning). Dependabot stays security-only. When it bumps an onboarded workflow it also updates the lockfile; a bump to release.yml would still need dist-workspace.toml updated to match.

Evidence

  • gh actions-lock --verify --ignore-local-actions (v0.4.1) and the main build: all 10 workflows valid; rerunning the generator is a no-op.

  • node tools/scripts/dist.mjs --check with dist 0.34.0: passes.

  • node --test packages/cli/test/release.test.mjs 7/7. The action.yml pins test in github-action/test/action.test.mjs passes; the suite's other tests need a built CLI, which CI provides.

  • actionlint, oxfmt --check, check:links, check:portability, check:boundaries: pass.

  • Documentation that this change affects is updated, and generated reference
    pages are regenerated (npm run docs:generate).

  • Fixes include a regression test.

  • No credentials, private source or machine-specific paths are included.

Every workflow is onboarded to .github/workflows/actions.lock (gh actions-lock),
which locks each action, and the actions those actions use, to its commit.
Workflows and the repository's composite actions name actions by their exact
release tags at the commits they were already pinned to, as the lockfile docs
recommend; the composite actions are called as `$/` so their actions are locked.
The published action.yml keeps its SHAs for its consumers, and action-e2e keeps
`uses: ./` with a never-run composite that locks that action's actions.

dist's github-action-commits now hold the same tags, so release.yml stays
exactly what dist generates. CI's actions-lock job verifies the lockfile.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Workflow-wide lockfile enforcement needs human CI confirmation because hosted-runner validation is unavailable and access to gh-actions-lock and its unreleased generator fixes was denied.

No open issues 🎉

What changed in this PR

Adopts a workflow dependency lockfile across Projections’ 10 workflows, moving action references to exact release tags while retaining locked commits and the published action’s SHA pins.

Changes:

  • Adds actions.lock and migrates internal composite-action calls to self-repository syntax.
  • Adds CI lockfile verification and a dependency-listing composite for testing the local published action.
  • Updates release-generation inputs, regression tests, contributor documentation, and targeted actionlint exceptions.
File Description
packages/​integrations/​github-action/​test/​action.test.mjs Checks that the dependency composite matches the published action’s pins.
packages/​cli/​test/​release.test.mjs Requires exact release tags and workflow lockfile entries.
docs/​runner/​building.md Documents additional actionlint exceptions.
dist-workspace.toml Uses exact action tags for release generation.
CONTRIBUTING.md Documents lockfile maintenance and exceptions.
.github/​workflows/​release.yml Updates generated release action references to exact tags.
.github/​workflows/​release-proof.yml Uses exact tags for release validation actions.
.github/​workflows/​release-inputs.yml Uses exact tags for release-input preparation.
.github/​workflows/​release-approval.yml Uses exact tags for artifact download and attestation.
.github/​workflows/​publish-schemas.yml Uses exact tags for schema publication actions.
.github/​workflows/​publish-npm.yml Uses exact tags for npm publication actions.
.github/​workflows/​move-major-tag.yml Uses exact tags for major-tag maintenance actions.
.github/​workflows/​engine-quality.yml Migrates action tags and composite-action references.
.github/​workflows/​copilot-setup-steps.yml Uses exact tags for checkout and Node setup.
.github/​workflows/​ci.yml Adds lockfile verification and migrates action references.
.github/​workflows/​actions.lock Records workflow dependencies, commits, and repository identities.
.github/​release-build-setup.yml Aligns the release download step with exact-tag references.
.github/​actions/​verus/​action.yml Uses an exact cache action tag.
.github/​actions/​rust-quality/​action.yml Uses exact tags for Rust quality tooling actions.
.github/​actions/​package/​action.yml Uses an exact Node setup tag.
.github/​actions/​check/​action.yml Uses exact tags for build and check toolchain actions.
.github/​actions/​browser/​action.yml Uses exact tags for setup and failure-artifact upload.
.github/​actions/​action-e2e/​action.yml Adds comments explaining the retained local action reference.
.github/​actions/​action-dependencies/​action.yml Lists published-action dependencies for CI lockfile coverage.
.github/​actionlint.yaml Adds scoped exceptions for self-repository syntax and the never-run step.

Review effort: Balanced

@agorischek
agorischek merged commit 253a12e into main Nov 19, 2026
63 checks passed
@agorischek
agorischek deleted the actions-lockfile branch November 19, 2026 17:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants